<template>
  <div>
    <h1>信息的接收</h1>
    <p>接收到的信息为：{{ mess }}</p>
  </div>
</template>

<script setup>
const nuxtApp = useNuxtApp();
const mess = ref("");
onMounted(() => {
  nuxtApp.$eventBus.on("message", (data) => {
    mess.value = data;
  });
});

onUnmounted(() => {
  nuxtApp.$eventBus.off("message");
});
</script>

<style lang="scss" scoped></style>
